<template>
    <button class="Btn" @click="emit('submit-request')">
        <div class="sign">
            <lord-icon src="https://cdn.lordicon.com/rfoqztsr.json" trigger="loop" delay="1500" colors="primary:#ffffff"
                style="width:25px; height:25px">
            </lord-icon>
        </div>
        <div class="text"><code>PLAY</code></div>
    </button>
</template>

<script setup>
    const emit = defineEmits(['submit-request'])
</script>

<style scoped>
/* From Uiverse.io by vinodjangid07 */
.Btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition-duration: .3s;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.199);
    background: linear-gradient(to right, #C66DEE, #91BBED);
}

/* plus sign */
.sign {
    width: 100%;
    transition-duration: .3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sign svg {
    width: 17px;
}

.sign svg path {
    fill: white;
}

/* text */
.text {
    position: absolute;
    right: 0%;
    width: 0%;
    opacity: 0;
    color: white;
    font-size: 1.2em;
    font-weight: 600;
    transition-duration: .3s;
}

/* hover effect on button width */
.Btn:hover {
    width: 125px;
    border-radius: 40px;
    transition-duration: .3s;
    background: linear-gradient(to right, #C66DEE, #91BBED);
}

.Btn:hover .sign {
    width: 30%;
    transition-duration: .3s;
    padding-left: 20px;
}

/* hover effect button's text */
.Btn:hover .text {
    opacity: 1;
    width: 70%;
    transition-duration: .3s;
    padding-right: 10px;
}

/* button click effect*/
.Btn:active {
    transform: translate(2px, 2px);
}
</style>